<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<h1>解构数组</h1>
		<p>就是把数组解析为单个的变量</p>
		<script>
		// 01 把数组解析单个的变量
		// 02 可以逗号跳过某个元素
		let arr = [1,3,5,7,9,11,12,13];
		let [a,,b,...c] = arr;
		console.log(a);
		console.log(b);
		console.log(c);
		// 03 可以给默认值
		// 04 通过...接收剩余内容(不定参)
		let arr2 = [1,2,3,4];
		let [d,e,f,g=88] = arr2;
		console.log(d,e,f,g)
		// 05 可以交换变量
		var k = 100;
		var j = 50;
		[k,j] = [j,k];
		console.log(k,j);
	 
		 
		</script>
	</body>
</html>
